<template>
	<view>
		<!-- #ifdef MP-WEIXIN -->
		<navbar :bgColor="bgColor" :btnColors='btnColor' :title="title" :isGoBack="true" :isNotice="true" :visible="true"></navbar>
		<!-- #endif -->
		
		<view class="flex pl-30 pr-30 pt-20" style="background-color: white;">
			<rich-text :nodes="content"></rich-text>
		</view>
		
		<view class="about-button" style="background-color: #ffffff" v-if="type !=16">
			<view class="ml-15">											
				<button class="about-button-alipay" style="background:#36B3E9;border: #36B3E9;color: #ffffff;height: 88rpx;text-align: center;line-height: 81rpx;" @click="dologin">					
					<view class=" ml-10">
						我已阅读并同意服务协议
					</view>
				</button>
			</view>			
		</view>	
		
		
	</view>
</template>

<script>
	export default {
		data () {
			return {
				...getApp().globalData.config,
				type:1,
				content:'',
			}
		},
		  // 你的其他选项...
		  onLoad(options) {
			this.type=options.type
		    this.setAlipayTitle();
		  },
		  methods: {
			  ...getApp().globalData.funcion,
		    setAlipayTitle() {
				// 仅在支付宝小程序中调用
				let title=''
				if(this.type ==1) title='隐私政策';
				else if(this.type == 2) title='用户协议';
				else if(this.type == 3) title='用户协议';
				else if(this.type == 4) title='用户租赁服务协议';
				else if(this.type == 15) title='计费规则';
				else if(this.type == 16) title='商务合作';
				this.title=title
				this.$http.agreement({type:this.type}).then(res=>{
					this.content=res.data.content
				})
		    },
			dologin(){
				uni.navigateBack({
					delta:1
				})
			}
		  }
	}
</script>

<style>
	page{
		background-color: #fff;
	}
	
	.about-button{
		display: flex;
		flex-direction: row;
		justify-content: center;
		position: fixed;
		bottom: 0;
		left: 50%;
		width: 100%;
		transform: translateX(-50%);
		padding-bottom: 40rpx;
		padding-top: 20rpx;
		font-size: 28rpx;
		line-height: 80rpx;
		height: 80rpx;
		color: #FFFFFF;
		 border: none !important;
	}
	
	
	.about-button-alipay{
		display: flex;
		justify-content: center;
		width: 620rpx;
		font-size: 28rpx;
		color: #031F37;
		border: none !important;
		border-radius: 40rpx;
		
	}
	
	
	.rich-text-content {
	  margin: 10px;
	  padding: 10px;
	  background-color: #f5f5f5;
	  color: #333;
	}
	
	.rich-text-content span {
	  font-weight: bold;
	}
	
	.rich-text-content a {
	  color: blue;
	}
</style>